<?php 
defined('_JEXEC') or die('Restricted access');

AdminUIHelper::startAdminArea ();
	// lay donviquanlyList
	$donviquanlyList=$this->donviquanlyList;
	$phongbanList=$this->phongbanList;
	$canboList=$this->canboList;
	$iddonvi=$this->iddonvi;
	$idphongban=$this->idphongban;
?>
<form name="adminForm" method="post">
	<input type='hidden' name='task' />
	<fieldset>
		<legend>Chi tiết thêm mới User account</legend>
		<table class="admintable">
			<tr>
				<td class="key">Đơn vị quản lý</td>
				<td>
					<select id="iddonvi" name="iddonvi" style="width:250px;" onchange="document.adminForm.submit();">
						<?php 
							echo '<option value="0">---  chọn  ---</option>';
							foreach ($donviquanlyList as $item)
							{
								echo ($iddonvi==$item->dvql_id)? 
								'<option selected="selected" value="'.$item->dvql_id.'">'.$item->dvql_ten.'</option>':
								'<option value="'.$item->dvql_id.'">'.$item->dvql_ten.'</option>';
							}
							echo '<option value="0">--- tất cả  ---</option>';
						?>						
					</select>
				</td>
			</tr>
			
			<tr>
				<td class="key">Phòng ban</td>
				<td>
					<select id="idphongban" name="idphongban" style="width:250px;" onchange="document.adminForm.submit();">
						<?php 
							echo '<option value="0">---  chọn  ---</option>';
							foreach ($phongbanList as $item)
							{
								echo ($idphongban==$item->pb_id)? 
								'<option selected="selected" value="'.$item->pb_id.'">'.$item->pb_ten.'</option>':
								'<option value="'.$item->pb_id.'">'.$item->pb_ten.'</option>';
							}
							echo '<option value="0">--- tất cả  ---</option>';
						?>						
					</select>
				</td>
			</tr>
			
			<tr>
				<td class="key">Cán bộ</td>
				<td>
					<select id="idcanbo" name="idcanbo" style="width:250px;">
						<?php 
							echo '<option value="0">---  chọn  ---</option>';
							foreach ($canboList as $item)
							{
								echo '<option value="'.$item->cb_id.'">'.$item->cb_ten.'</option>';
							}
						?>						
					</select>
				</td>
			</tr>
			
			
			<tr>
				<td class="key">User name</td>
				<td><input style="width:250px;" type="text" name="username" /></td>
			</tr>
			<tr>
				<td class="key">Password</td>
				<td><input style="width:250px;" type="text" name="password" /></td>
			</tr>
			<tr>
				<td class="key">Email</td>
				<td><input style="width:250px;" type="text" name="email" /></td>
			</tr>
			<tr>
				<td class="key">Quyền truy cập</td>
				<td>
					<select id="typeaccount" name="typeaccount">
						<option value="nhanvien">Nhân viên</option>	
						<option value="quantriphongban">Quản trị phòng ban</option>	
						<option value="quantridonvi">Quản trị đơn vị</option>	
					</select>
				</td>
			</tr>
		</table>
	</fieldset>
</form>